Traffic shaping apparatus and traffic shaping method

ABSTRACT

A traffic shaping apparatus calculates a minimum transmission interval, an allowed transmission frame rate of a user frame, and a reference transmission interval for each user according to a minimum transmission frame rate and a peak transmission frame rate specified for each user. The traffic shaping apparatus also calculates a first estimated transmission time according to the reference transmission interval, and a second estimated transmission time according to the minimum transmission interval for each user. The traffic shaping apparatus determines the user having the earliest first estimated transmission time, and determines according to the second estimated transmission time of the user whether a user frame is to be transmitted.

BACKGROUND OF THE INVENTION

The present invention relates to traffic shaping apparatuses and trafficshaping methods, and more particularly, to a traffic shaping apparatusand a traffic shaping method which effectively use a transmission framerate in response to a change in transmission frame rates used by theusers.

Before starting to use a public network (or public line) forcommunication, the user makes a contract with the administrator of thepublic network for a transmission frame rate, frame (packet) transferpriority, and others. After such a contract is exchanged between theuser and the administrator of the public network, the user uses userterminals to start transmitting frames to the public network. A relayapparatus at the administrator side, positioned at the entrance of thepublic network, monitors the transmission frame rate of the userterminal, and if the contracted transmission frame rate is exceeded,lowers the frame priority of the violating user terminal or discardsviolating frames. This monitoring function of the public network iscalled a policing function or usage parameter control (UPC). Even if aframe is discarded during communication, the receiving terminal usuallynotices that the frame was discarded and requests the transmittingterminal to re-send the frame. Since the transmitting terminal re-sendsthe frame in response to this request, the finally received informationhas no omission. However, re-transmission may make a transfer delay verylong, or resent frames may cause congestion in the network. Therefore,it is preferred that frame discarding not occur. It is necessary for arelay apparatus at the user side, which transmits frames to the publicnetwork, to control the transmission frame rate during frametransmission such that frames are not discarded in the public network.Such a function to control the transmission frame rate is called atraffic shaping function or simply a shaping function. A traffic shapingapparatus for implementing the traffic shaping function may be includedin a relay apparatus directly connected to the public network and theuser transmission terminal, such as those described above, or in a relayapparatus disposed at the exit of the public network to transmit framesto a private user network.

As such a shaping apparatus, an apparatus having a queue forhigh-priority packets and a queue for low-priority packets has beenproposed. If there is no transmission-pending packet in a priority queueat the time of packet transmission from the priority queue, in order toeffectively use the transmission frame rate, the shaping apparatus giveshigh priority to a transmission-pending packet in a non-priority queueand then sends it. Such a shaping apparatus is disclosed, for example,in EP Publication No. 1054544A2 (corresponding to Japanese UnexaminedPatent Application Publication No. 2000-332787).

SUMMARY OF THE INVENTION

To implement the shaping function, the minimum transmission frame rate(MFR) and a peak frame rate (PFR) are specified for each user in ashaping apparatus in some cases. The hardware of the shaping apparatusrecognizes the active state (while in transmitting a frame through aline) or the inactive (while not transmitting a frame) state of eachuser and dynamically calculates an allowed transmission frame rate(AFR), using the MFR and the PFR. The shaping apparatus determines thehighest-priority transmission user according to an estimatedtransmission time A calculated from the AFR, and transmits a frame fromthe queue corresponding to the user when the estimated transmission timeA arrives. The shaping apparatus does not transmit a frame until theestimated transmission time A arrives. In this way, the shapingapparatus transmits a frame when the estimated transmission time Aarrives, to implement frame transmission based on the AFR.

Even when the frame rate which a user uses is lower than the calculatedAFR in the shaping apparatus, because it does not mean that the userstatus becomes inactive, the AFR for the user does not change.Accordingly, the AFRs for the other users do not change either.Therefore, even after the above-user's frame rate becomes lower than theAFR, the other users can only use the same transmission frame rates asthose used before the above-user's frame rate became lower than the AFR.In this case, there is some remaining frame rate which is not used byany user. For example, when user 1 has an MFR of 100 Mbps, user 2 has anMFR of 100 Mbps, and the maximum frame rate of the line is 1 Gbps, theAFR of each user is 500 Mbps. If the actual frame rate of user 1 is 300Mbps, since the AFR of user 2 does not change from 500 Mbps, user 1 anduser 2 use a total frame rate of only 800 Mbps in the line. Therefore,the remaining frame rate in the line, that is, 200 Mbps, is not used byany user. If the frame rate of user 1 is then reduced to 50 Mbps, whichis lower than the MFR, the AFR of user 2 does not change from 500 Mbps.Therefore, both users use a total frame rate of only 550 Mbps in theline. The remaining frame rate, 450 Mbps, in the maximum frame rate ofthe line is not used by any user. In this way, if the frame rate of auser becomes lower than the AFR, or even lower than the MFR, no user canuse the remaining frame rate obtained by subtracting the actual userframe rate from the AFR. Thus, the frame rate of the line is noteffectively used.

If the AFR of a user exceeds the PFR, since no user can use a frame ratehigher than the PFR in the shaping apparatus, the shaping apparatusreduces the AFR to the PFR. Also in this case, since the AFRs of theother users do not change, a frame rate which cannot be used by any useris left. When user 1 has an MFR of 100 Mbps, user 2 has an MFR of 100Mbps, and the maximum frame rate of the line is 1 Gbps as in the aboveexample, for example, the AFR of each user is 500 Mbps. If the PFR ofuser 1 is 300 Mbps and the PFR of user 2 is 1 Gbps, the AFR of user 1 isnot 500 Mbps but is set to 300 Mbps, which is the same as the PFR.Therefore, the sum of the AFR of user 1 and the AFR of user 2 is 800Mbps; in other words, the total frame rate which user 1 and user 2 canuse is 800 Mbps. The remaining frame rate, 200 Mbps, in the maximumframe rate of the line is not used by any user. In this way, if the AFRof a user exceeds the PFR, no user can use the remaining frame rateobtained by subtracting the PFR from the AFR. Thus, the frame rate isnot effectively used.

Accordingly, it is an object of the present invention to provide anapparatus and method which effectively use a frame rate left unused dueto a change in the frame rates of the users.

Another object of the present invention is to provide an apparatus andmethod which use a frame rate not used by any user when the frame rateof one user becomes lower than the allowed frame rate (AFR).

Still another object of the present invention is to provide an apparatusand method which use a frame rate not used by any user when the allowedframe rate (AFR) of one user exceeds the peak frame rate (PFR).

An object of the present invention is achieved in one aspect of thepresent invention through the provision of a traffic shaping apparatusfor controlling an allowed transmission frame rate of user framesaccording to frame rates specified in advance for each user whotransmits and receives the user frames through a network. The trafficshaping apparatus includes a plurality of frame queues, each providedfor a corresponding user, for storing the user frames of thecorresponding user; a frame-rate storage section for storing a minimumtransmission frame rate and a peak transmission frame rate specified foreach user; a transmission-interval calculation section for calculatingan allowed transmission frame rate of user frames for each user by usingthe minimum transmission frame rate or the peak transmission frame rate,for calculating a reference transmission interval of the user frames foreach user by using the calculated allowed transmission frame rate, andfor calculating a minimum transmission interval for each user by usingthe peak transmission frame rate; a transmission-interval storagesection for storing the reference transmission interval and the minimumtransmission interval for each user; a time calculation section forcalculating a first estimated transmission time for each user by usingthe reference transmission interval and for calculating a secondestimated transmission time for each user by using the minimumtransmission interval; a time storage section for storing the firstestimated transmission time and the second estimated transmission timefor each user; a determination section for determining the user havingthe earliest first estimated transmission time among one or more userscorresponding to one or more frame queues where at least one user frameis stored, and for determining according to the second estimatedtransmission time of the determined user whether a user frame is to betransmitted; a frame reading section for reading the user frame from theframe queue corresponding to the determined user when the determinationsection has determined that the user frame of the determined user is tobe transmitted; and a transmission section for transmitting the readuser frame.

An object of the present invention is achieved in another aspect of thepresent invention through the provision of a traffic shaping method forcontrolling the transmission frame rates of user frames according toframe rates specified in advance for each user who transmits andreceives the user frames through a network. The traffic shaping methodincludes the steps of setting a minimum transmission frame rate and apeak transmission frame rate for each user; calculating a minimumtransmission interval for each user by using the peak transmission framerate; calculating an allowed transmission frame rate of user frames foreach user by using the minimum transmission frame rate or the peaktransmission frame rate; calculating a reference transmission intervalof the user frames for each user by using the allowed transmission framerate; calculating a first estimated transmission time for each user byusing the reference transmission interval; calculating a secondestimated transmission time for each user by using the minimumtransmission interval; receiving a user frame for each user and storingit in association with the user; determining the user having theearliest first estimated transmission time among one or more users forwhom at least one user frame is stored; determining according to thesecond estimated transmission time of the determined user whether a userframe is to be transmitted; and transmitting the user frame of thedetermined user when it has been determined that the user frame of thedetermined user is to be transmitted.

An object of the present invention is achieved in yet another aspect ofthe present invention through the provision of a relay apparatusconnected to a plurality of lines, for relaying frames between thelines. The relay apparatus includes a plurality of interface sections,each connected to at least one of the plurality of lines, fortransmitting and receiving a frame to and from the line, the pluralityof interface sections each including a frame buffer for temporarilystoring the frame; a relay section connected to the plurality ofinterface sections, for determining the interface sections, connected toa line through which the frame is to be transmitted according to headerinformation included in a frame received by the each interface sections,and for relaying the frame to the determined interface section; and atraffic shaping apparatus connected to at least one of the plurality ofinterface sections and to the relay section, for controlling an allowedtransmission frame rate according to frame rates specified in advancefor each user who transmits and receives a frame through a line, and fortransmitting a frame. The traffic shaping apparatus includes aframe-rate storage section for storing a minimum transmission frame rateand a peak transmission frame rate specified for each user; atransmission-interval calculation section for calculating an allowedtransmission frame rate of frames for each user by using the minimumtransmission frame rate or the peak transmission frame rate, forcalculating a reference transmission interval of the frames for eachuser by using the calculated allowed transmission frame rate, and forcalculating a minimum transmission interval for each user by using thepeak transmission frame rate; a transmission-interval storage sectionfor storing the reference transmission interval and the minimumtransmission interval for each user; a time calculation section forcalculating a first estimated transmission time for each user by usingthe reference transmission interval and for calculating a secondestimated transmission time for each user by using the minimumtransmission interval; a time storage section for storing the firstestimated transmission time and the second estimated transmission timefor each user; a determination section for determining the user havingthe earliest first estimated transmission time among one or more usersfor whom at least one frame is stored in the frame buffer, and fordetermining whether a frame is to be transmitted according to the secondestimated transmission time of the determined user; a frame readingsection for reading the frame of the determined user from the framebuffer when the determination section has determined that the frame ofthe determined user is to be transmitted; and a transmission section fortransmitting the read frame to one of the lines through one of theplurality of interface sections.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view showing an example structure of a packet relayapparatus provided with shaping apparatuses according to an embodimentof the present invention.

FIG. 2 is a structural view of a shaping apparatus.

FIG. 3 is a view showing the relationship between estimated transmissiontime and frame transmission timing.

FIG. 4 is a flowchart of transmission and receiving processing performedby the shaping apparatus.

FIG. 5 is a flowchart of an INC calculation performed by an AFRcalculation unit 11.

FIG. 6 is a view showing timing for transmission of frames havingdifferent numbers of bytes from a reference number of bytes.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 shows an example structure of a packet relay apparatus havingshaping apparatuses.

The packet relay apparatus is formed of a plurality of line interfaces50, a plurality of routing processing sections 30, and at least oneswitch 60. At least one line interface 50 has a shaping apparatus 10.

Each line interface 50 is connected to one line or a plurality of lines.The line interface 50 is provided with a physical-layer handlingsection, and performs frame (packet) input and output operations throughthe physical-layer handling section to and from a connected line. Eachrouting processing section 30 is connected to one or more lineinterfaces 50 and to the switch 60. The routing processing section 30receives a frame from the connected line interface 50, determines therouting destination of the frame according to the destination addressincluded in the frame, and relays the frame to the switch 60 or to anyof the line interfaces 50. The switch 60, when it receives the framefrom the routing processing section 30, relays the frame according tothe routing destination determined by the routing processing section 30to an appropriate routing processing section 30.

The shaping apparatus 10 is disposed in at least one line interface 50.The shaping apparatus 10 receives a frame from the routing processingsection 30, checks header information in the frame to determine the userof the frame, and transmits the frame according to an allowedtransmission frame rate (AFR) specified or calculated for each user.

When the packet relay apparatus shown in FIG. 1 is disposed in anetwork, a frame rate assigned to each user can be controlled in thenetwork by the function of the shaping apparatuses 10. The packet relayapparatus can have any appropriate structure other than that shown inFIG. 1.

FIG. 2 shows the structure of the shaping apparatus 10. The shapingapparatus 10 is provided with an AFR calculation unit 11, anestimated-transmission-time (OTIME) calculation unit 12, a transmissiondetermination unit 13, a queuing-destination determination unit 14, aframe-buffer management unit 15, a receiving interface 16, and atransmission interface 17. The shaping apparatus 10 is also providedwith a frame-rate-information storage memory 21, areference-transmission-interval (INC) storage memory 22, and an OTIMEstorage memory 23. The shaping apparatus 10 is connected to a framebuffer 24 having a queue for each user and to a physical-layer handlingsection 40, both provided for the line interface 50, and is furtherconnected to the routing processing section 30, which is outside theline interface 50. The frame buffer 24 and memories 21 to 23 may beprovided outside the shaping apparatus 10. The frame buffer 24 andmemories 21 to 23 may be implemented by a memory externally connected tothe line interface 50. The frame buffer 24 may be internally provided inthe shaping apparatus 10.

The shaping apparatus 10 shown in FIG. 2 can be made as a large-scaleintegration (LSI), such as an application specification integratedcircuit (ASIC) or a field programmable gate array (FPGA). Such LSI isprovided with the AFR calculation unit 11, theestimated-transmission-time (OTIME) calculation unit 12, thetransmission determination unit 13, the queuing-destinationdetermination unit 14, the frame-buffer management unit 15, thereceiving interface 16, the transmission interface 17, and the OTIMEstorage memory 23. The LSI may also include the frame-rate-informationstorage memory 21 and the reference-transmission-interval (INC) storagememory 22.

The receiving interface 16 is connected to the routing processingsection 30, which is outside the line interface 50, and receives a framefrom the routing processing section 30. The receiving interface 16 sendsthe received frame to the frame-buffer management unit 15, and alsosends the header information of the frame to the queuing-destinationdetermination unit 14.

The queuing-destination determination unit 14 receives the headerinformation of the frame from the receiving interface 16, and determinesthe queuing destination of the frame according to the received headerinformation. For example, the queuing-destination determination unit 14determines the queuing destination according to the value of VLAN IDincluded in the received header information. The queuing-destinationdetermination unit 14 may determine the queuing destination according toappropriate information included in the header information, other thanVLAN ID.

The frame-buffer management unit 15 receives the frame from thereceiving interface 16, and writes the received frame at the end of thequeue in the frame buffer 24 according to the queuing destinationdetermined by the queuing-destination determination unit 14. Theframe-buffer management unit 15 reads the transmission-pending framedisposed at the top of the queue of the user for whom the transmissiondetermination unit 13 has decided to perform transmission, from theframe buffer 24, and transmits the frame through the transmissioninterface 17.

The frame buffer 24 has a plurality of queues where received frames arestored. A queue is provided for each user. The frame-buffer managementunit 15 stores a frame received by the shaping apparatus 10 in the queuecorresponding to the queuing destination determined by thequeuing-destination determination unit 14. Frames stored in each queueare sequentially read and transmitted by the frame-buffer managementunit 15.

The transmission interface 17 is connected to the physical-layerhandling section 40 located in the line interface 50, and transmits aframe sent from the frame-buffer management unit 15 to thephysical-layer handling section 40.

The frame-rate-information storage memory 21 stores a minimumtransmission frame rate (MFR) and a peak transmission frame rate (PFR)specified in advance, as well as the AFR calculated by the AFRcalculation unit 11, for each user. The frame-rate-information storagememory 21 may further store the maximum frame rate of the line used. TheINC storage memory 22 stores a reference transmission interval (INC)based on the AFR and the minimum transmission interval (PINC) based onthe PFR calculated by the AFR calculation unit 11, for each user. TheOTIME storage memory 23 stores, for each user, a first estimatedtransmission time A for heap tournament and a second estimatedtransmission time P for transfer check calculated by the OTIMEcalculation unit 12, and a flag indicating whether there is atransmission-pending frame for each user. The flag indicating whetherthere is a transmission-pending frame is appropriately written, forexample, by the frame-buffer management unit 15 or other units.

The AFR calculation unit 11 dynamically calculates the AFR and INC foreach user periodically according to the MFR and/or PFR stored in advancein the frame-rate-information storage memory 21. The AFR calculationunit 11 also stores the results of calculation in the INC storage memory22 in association with each user.

The users here do not mean individual terminals or terminal usersthemselves but represent line-contracting parties, such as individuals,corporate bodies, organizations, or associations. The users can bedistinguished, for example, by VLAN IDs.

The AFR calculation unit 11 will be described below in detail.

For example, the AFR calculation unit 11 reads the MFR and PFR for eachuser stored in advance in the frame-rate-information storage memory 21and uses the following expression to calculate the AFR:AFR=(maximum frame rate of the line used by the user) ×(user MFR)/(sumof the MFRs of active users on the line)The maximum frame rate of the line is specified in advance and stored inan appropriate memory.

When it is assumed that the maximum frame rate of the line used by user1 and user 2 is 1 Gbps, the MFR of user 1 is 100 Mbps, and the MFR ofuser 2 is 400 Mbps, for example, these values are substituted in theabove expression to calculate the AFR of each user, as follows:AFR of user 1=1Gbps×100Mbps/(100Mbps+400Mbps)=200MbpsAFR of user 2=1Gbps×400Mbps/(100Mbps+400Mbps)=800Mbps

The maximum frame rate of the line is divided and assign to each useraccording to the ratio of the MFRs, as shown in the calculation results.If the calculated AFR exceeds the read PFR, that is, the peak frame rateof the user, the AFR calculation unit 11 sets the AFR to the PFR. In theabove AFR calculation example, the calculation is performed such thatthe maximum frame rate of the line is divided and assigned according tothe MFR of each user. The AFR may be obtained according to anappropriate calculation expression other than that used above.

The AFR calculation unit 11 further calculates the INC by using thefollowing expression:INC=(maximum frame rate which the shaping apparatus can shape)/AFRThe PINC is calculated according to the following expression. When thePFR is specified for each user, the PINC is calculated and stored in theINC storage memory 22 prior to the calculation of the INC.PINC=(maximum frame rate which the shaping apparatus can shape)/PFR

The maximum frame rate which the shaping apparatus can shape is the sumof the maximum frame rates of one or more lines connected to the shapingapparatus 10. The shaping apparatus 10 has a shaping capability ofcontrolling the maximum frame rates of all the connected lines. The INCindicates the transmission interval used when a frame is transmitted atthe AFR. Usually, the shaping apparatus calculates, for each user, afirst estimated transmission time A when the next frame is to betransmitted, by using the INC. When the first estimated transmissiontime A matches the current time, or indicates a time in the pastcompared with the current time, the shaping apparatus transmits a frameof the user.

The PINC indicates the transmission interval used when a frame istransmitted at the PFR. The AFR becomes lower than the PFR in many casesdue to the relationship with other active users. Even when the userframe rate becomes lower than the AFR, it does not mean that the userstatus becomes inactive. Therefore, the AFRs of the other users do notchange. Consequently, the frame rate obtained by subtracting the userframe rate lower than the AFR from the AFR is not used by any user,which means that the frame rate is not effectively used. If the shapingapparatus can transmit a frame by using a frame rate higher than the AFRbut lower than the PFR in this case, the frame rate of the line iseffectively used. The PINC indicates the timing when the user cantransmit a frame if the other users are not using the line.

The shaping apparatus 10 calculates a second estimated transmission timeP according to the PINC, and transmits a frame at the second estimatedtransmission time P, which is earlier than the first estimatedtransmission time A, if the other users are not using the line. Theshaping apparatus 10 can transmit a frame even after the secondestimated transmission time P but before the first estimatedtransmission time A.

The OTIME calculation unit 12 calculates the first estimatedtransmission time A and the second estimated transmission time Paccording to the INC and PINC stored in the INC storage memory 22. Forexample, the OTIME calculation unit 12 reads the INC obtained accordingto the AFR and the PINC obtained according to the PFR from the INCstorage memory 22, and uses the following expressions to calculate thefirst estimated transmission time A and the second estimatedtransmission time P.First estimated transmission time A=(previous estimated transmissiontime)+INCSecond estimated transmission time A=(previous estimated transmissiontime)+PINC

The previous estimated transmission time can be obtained from a timer orcounter disposed inside or outside the shaping apparatus 10. The OTIMEcalculation unit 12 stores the results of calculation in the OTIMEstorage memory 23 in association with each user.

When the queuing-destination determination unit 14 determines that aframe was received when there was no frame in the destination queue, theOTIME calculation unit 12 sets the first estimated transmission time Aand the second estimated transmission time P to the earliest time whenthe received frame can be transmitted. For example, the first estimatedtransmission time A and the second estimated transmission time P can beset to the current time or the current time plus a reference time.

The reference time corresponds, for example, to “1” in the timer, and iscalculated by using the following expression according to the maximumframe rate which the shaping apparatus 10 can shape and a referencenumber of bytes.Reference time [s]=(reference number of bytes)×8 [bits]/(maximum framerate [bps] which the shaping apparatus can shape)

The reference number of bytes is the number of bytes in a frametransmitted or received by the shaping apparatus 10. In other words, theshaping apparatus 10 can transmit a frame having the reference number ofbytes within the reference time.

For example, when the maximum frame rate which the shaping apparatus 10can shape is 1 Gbps and the reference number of bytes is 64, thereference time equals 64×8/(1 Gbps), which is 512 ns. The value is setto “1” in the timer. The shaping apparatus 10 can transmit a framewritten in a queue of the frame buffer 24 at intervals corresponding tothe reference time.

The transmission determination unit 13 determines a user having atransmission-pending frame in the queue and having the highesttransmission priority by checking frames written in the frame buffer 24according to the first estimated transmission time A calculated by theOTIME calculation unit 12. The transmission determination unit 13 alsodetermines, according to the second estimated transmission time Pcalculated by the OTIME calculation unit 12, whether the determined useris ready to transmit. When the second estimated transmission time Pmatches the current time, or is in the past with respect to the currenttime, the transmission determination unit 13 instructs the frame-buffermanagement unit 15 to transmit the frame from the queue corresponding tothe determined user.

FIG. 3 shows the relationship between estimated transmission time andframe transmission timing.

It is assumed here, for example, that the shaping apparatus is connectedto only one line, the maximum frame rate of the line is 1 Gbps, and userX and user Y each having a PFR of 1 Gbps and an MFR of 100 Mbps are bothactive. In this case, the PINC of each user is calculated according tothe above-described expression, is found to be “1”, and is stored inthe. INC storage memory 22. The AFR of each user is calculated by theAFR calculation unit 11 according to the above-described expression, andfound to be 500 Mbps. The INC of each user is calculated by the AFRcalculation unit 11 and is found to be “2”.

When the shaping apparatus 10 transmits a frame, the OTIME calculationunit 12 calculates first estimated transmission times Ax and Ay, andsecond estimated transmission times Px and Py for the users. Assumingthat the shaping apparatus transmits a frame of the user X at time “1”,for example, the OTIME calculation unit 12 calculates the firstestimated transmission time Ax and the second estimated transmissiontime Px as follows:Ax =(previous estimated transmission time)+INC=1+2=3Px=(previous estimated transmission time)+PINC=1+1=2

When the frame rate of each user is not lower than the AFR(corresponding to time “1” to time “5” in FIG. 3), the frames of user Xand user Y are transmitted at the first estimated transmission times Axand Ay corresponding thereto.

When the frame rate of user Y becomes lower than the AFR and there is noframe to be transmitted (corresponding to time “6” and time “7” in FIG.3), a conventional shaping apparatus would not have transmitted anyframe at time “6” and time “7”. However, the shaping apparatus 10 whichhas been described uses the second estimated transmission time P totransmit frames of user X at time “6” and time “7”. At time “6” and time“7”, the shaping apparatus 10 selects a user who has the earliest firstestimated transmission time. A among users who have transmission-pendingframes in their queues. In the current case, user X is selected. Then,the shaping apparatus 10 compares the second estimated transmission timeP of the selected user with the current time. When the second estimatedtransmission time P matches the current time, or the second estimatedtransmission time indicates a past time compared with the current time,the shaping apparatus 10 transmits a frame of the selected user. Asshown in FIG. 3, for example, after a frame of user X is transmitted attime “15”, the OTIME calculation unit 12 calculates a second estimatedtransmission time Px of “6”. Therefore, when the transmissiondetermination unit 13 compares the second estimated transmission time Pxwith the current time at time “6”, they match. Consequently, thetransmission determination unit 13 instructs the frame-buffer managementunit 15 to transmit a frame of the selected user X. In the same way,after the frame of user X is transmitted at time “6”, the OTIMEcalculation unit 12 calculates a second estimated transmission time Pxof “7”. Therefore, the second estimated transmission time Px matches thecurrent time also at time “7”, and the transmission determination unit13 again instructs the frame-buffer management unit 15 to transmit aframe of user X. The shaping apparatus 10 transmits the frames of user Xat time “6” and time “7” in this way.

Since the shaping apparatus 10 uses the second estimated transmissiontime P calculated based on the PFR in this way, each user can use aframe rate which the other users are not using.

It is assumed here, for example, that the shaping apparatus 10 newlyreceived a frame of user Y, and the frame of user Y is in the queue inthe frame buffer 24 at time “8”. In this case, among user X and user Ywho have transmission-pending frames in their queues, the shapingapparatus 10 selects user Y because user Y has the earlier firstestimated transmission time A. As shown in FIG. 3, since the OTIMEstorage memory 23 holds, at time “8”, a first estimated transmissiontime Ay of “6”, which was calculated by the OTIME calculation unit 12 attime “4”, and it is earlier than a first estimated transmission time Axof “9”, the transmission determination unit 13 selects user Y. Then, theshaping apparatus 10 compares the second estimated transmission time Pof the selected user with the current time. When the second estimatedtransmission time P matches the current time, or it is in the past withrespect to the current time, the shaping apparatus 10 transmits a frameof the selected user. More specifically, since the second estimatedtransmission time Py read from the OTIME storage memory 23 is “5” and itindicates a time in the past compared with the current time, thetransmission determination unit 13 instructs transmission of a frame ofuser Y. Therefore, the shaping apparatus 10 transmits a frame of user Yat time “8”.

If user X and user Y have transmission-pending frames in their queuesthereafter, the frames of these users are transmitted by the shapingapparatus 10 according to first estimated transmission times Ax and Aycalculated based on the AFRs (time “9” to time “12” in FIG. 3).

FIG. 4 is a flowchart of transmission and receiving processing performedby the shaping apparatus 10. The operation of the shaping apparatus 10will be specifically described below according to the flowchart.

When the shaping apparatus 10 is activated due to the activation of thepacket relay apparatus or for other reasons, the shaping apparatus 10specifies various initial settings in step S101. For example, theshaping apparatus 10 stores the MFR and PFR specified for each user inthe frame-rate-information storage memory 21, calculates the PINC, andstores it in the INC storage memory 22.

The MFR and PFR are determined according to the contract for each user.They are input into the packet relay apparatus together with theidentifier of each user, for example, by the administrator (operator)from an administrator terminal connected to the packet relay apparatus.They can be input at any time during the activation time and operationtime of the packet relay apparatus.

Then, the shaping apparatus 10 performs the following receivingprocessing and transmission processing at intervals corresponding to theabove-described reference time (processing time). The receivingprocessing will be described first. The receiving interface 16determines in step S103 whether a frame has been received. When thereceiving interface 16 determines in step S103 that a frame has beenreceived, the receiving interface 16 sends the received frame to theframe-buffer management unit 15. The receiving interface 16 also sendsthe header information of the received frame to the queuing-destinationdetermination unit 14. When the receiving interface 16 determines instep S103 that a frame has not been received, the shaping apparatus 10does not perform the following receiving processing, and starts thetransmission processing.

When the queuing-destination determination unit 14 receives the headerinformation of the frame from the receiving interface 16, thequeuing-destination determination unit 14 determines in step S105 thequeuing destination according to the received header information. Forexample, the queuing-destination determination unit 14 determines thequeuing destination according to an identifier (such as VLAN ID) foridentifying the user, included in the header information. In the shapingapparatus, a user number is assigned to each user to identify the user.Therefore, the queuing-destination determination unit 14 determines theuser number as the destination queue. The queuing-destinationdetermination unit 14 sends the determined queuing destination (usernumber) to the frame-buffer management unit 15.

When the frame-buffer management unit 15 receives the frame from thereceiving interface 16, the frame-buffer management unit 15 writes theframe into the queue in the frame buffer 24 according to the queuingdestination determined by the queuing-destination determination unit 14,in step S107. By the process of step S107, the frame is written into thequeue corresponding to the user number. If frame writing generates atransmission-pending frame for the user, the frame-buffer managementunit 15 may write, in the OTIME storage memory 23, a flag indicatingthat there is a transmission-pending frame for the user.

Then, the queuing-destination determination unit 14 determines in stepS109 whether the frame was received when there was notransmission-pending frame in the queue corresponding to the user numberdetermined in step S105. The queuing-destination determination unit 14may receive from the frame-buffer management unit 15, informationindicating that the frame-buffer management unit 15 wrote the frame inan empty queue. The queuing-destination determination unit 14 may checka flag indicating whether there is a transmission-pending frame storedin the OTIME storage memory before the frame-buffer management unit 15writes the frame into the queue. Alternatively, the queuing-destinationdetermination unit 14 may check the queue corresponding to the queuingdestination determined in step S105 to determine whether there is aframe. When the queuing-destination determination unit 14 determines instep S109 that the frame was received when there was no frame in thequeue, the queuing-destination determination unit 14 instructs the OTIMEcalculation unit 12 to calculate estimated transmission times. When thequeuing-destination determination unit 14 determines in step S109 thatthe frame was received when there was a frame in the queue, thequeuing-destination determination unit 14 gives no instruction to theOTIME calculation unit 12. In this case, the shaping apparatus 10terminates the receiving processing, and starts the transmissionprocessing.

When the OTIME calculation unit 12 receives the instruction from thequeuing-destination determination unit 14, the OTIME calculation unit 12calculates a first estimated transmission time A and a second estimatedtransmission time P in step S111 and step S113, respectively. The OTIMEcalculation unit 12 can set the first estimated transmission time A andthe second estimated transmission time P to the earliest time when thereceived frame can be transmitted (such as the current time or thecurrent time plus the reference time). The OTIME calculation unit 12also stores the calculated first estimated transmission time A andsecond estimated transmission time P at the addresses corresponding tothe determined user number in the OTIME storage memory 23.

The transmission processing will be described next.

The transmission determination unit 13 reads the first estimatedtransmission time A of each user, calculated by the OTIME calculationunit 12 from the OTIME storage memory 23, and determines thehighest-priority user (user having the earliest first estimatedtransmission time A) for whom a frame is to be transmitted, in stepS115. For example, the transmission determination unit 13 reads the flagindicating whether there is a transmission-pending frame, the flag beingstored in the OTIME storage memory 23 for each user, reads the firstestimated transmission time A of each user for whom the flag indicatesthat there is a transmission-pending frame from the OTIME storage memory23, compares the read first estimated transmission time A, finds theuser number corresponding to the earliest first estimated transmissiontime A, and determines the highest-priority user for whom a frame is tobe transmitted.

Then, in step S117, the transmission determination unit 13 reads thesecond estimated transmission time P of the determined user from theOTIME storage memory 23 to determine whether the determined user isready for transmission. For example, the transmission determination unit13 compares the read second estimated transmission time P with thecurrent time. When the read second estimated transmission time P matchesthe current time, or it indicates a time in the past compared with thecurrent time, the transmission determination unit 13 determines that aframe of the determined user can be transmitted. When the transmissiondetermination unit 13 determines in step S117 that the frame can betransmitted, the transmission determination unit 13 sends the usernumber of the determined user to the frame-buffer management unit 15 andinstructs the frame-buffer management unit 15 to read and transmit aframe from the queue corresponding to the user number. The transmissiondetermination unit 13 also outputs information indicating that thetransmission has been instructed and the user number of the determineduser to the OTIME calculation unit 12. When the transmissiondetermination unit 13 determines in step S117 that the frame cannot betransmitted, the transmission processing at the current time isterminated. The shaping apparatus 10 executes the receiving processingfrom step S103 when the next processing time arrives.

When the frame-buffer management unit 15 receives the user number andthe transmission instruction from the transmission determination unit13, the frame-buffer management unit 15 reads the frame disposed at thetop of the queue corresponding to the specified user number from theframe buffer 24, and transmits the frame through the transmissioninterface 17 in step S119. When the frame-buffer management unit 15determines, when the frame-buffer management unit 15 transmits theframe, that the queue corresponding to the user number no longer has atransmission-pending frame, the frame-buffer management unit 15 maywrite a flag indicating that there is no transmission-pending frame, atthe address corresponding to the user number in the OTIME storage memory23.

When the OTIME calculation unit 12 receives from the transmissiondetermination unit 13 information indicating that the transmission hasbeen instructed and the user number of the determined user, the OTIMEcalculation unit 12 reads the INC and PINC corresponding to the usernumber from the INC storage memory 22 in step S121.

The OTIME calculation unit 12 uses the read INC to calculate a firstestimated transmission time A according to the following expression instep S123.First estimated transmission time A=(previous estimated transmissiontime)+INC

The calculated first estimated transmission time A indicates the timewhen the next frame is to be transmitted from the queue corresponding tothe user number. Then, the OTIME calculation unit 12 uses the read PINCto calculate a second estimated transmission time P according to thefollowing expression.Second estimated transmission time P=(previous estimated transmissiontime)+PINC

The OTIME calculation unit 12 also stores the calculated first estimatedtransmission time A and second estimated transmission time P at theaddresses corresponding to the received user number in the OTIME storagememory 23.

The shaping apparatus 10 repeatedly executes the processes of step S103to step S125, described above.

FIG. 5 is a flowchart of an INC calculation performed by the AFRcalculation unit 11. The AFR calculation unit 11 periodically executesthe INC calculation irrespective of (not in synchronization with) theabove-described transmission and receiving processing.

When the shaping apparatus 10 is activated, the AFR calculation unit 11specifies initial settings in step S201. For example, the AFRcalculation unit 11 stores the maximum frame rate of the line, and theMFR and PFR specified for each user in the frame-rate-informationstorage memory and in other memories.

The AFR calculation unit 11 reads the MFR and PFR from the addressescorresponding to the user number of each user in theframe-rate-information storage memory 21 in step S203. The AFRcalculation unit 11 also reads the maximum frame rate of the line whichthe user will use, from the frame-rate-information storage memory 21 orother memories. Then, the AFR calculation unit 11 uses the read MFRand/or PFR of each user to calculate the AFR for the user in step S205.For example, the AFR calculation unit 11 calculates the AFR according tothe following expression such that the maximum frame rate of the line isdivided and assigned to each user according to the MFR of the user.AFR=(Maximum frame rate of the line used by the user)×(user MFR)/(sum ofthe MFRs of active users using the line)

If the AFR calculated for each user exceeds the PFR of the user, the AFRcalculation unit 11 sets the AFR to the PFR. The AFR calculation unit 11may calculate the AFR according to an expression other than thatdescribed above.

The AFR calculation unit 11 further calculates the INC for each useraccording to the following expression in step S207.INC=(Maximum frame rate which the shaping apparatus can shape)/AFR

The AFR calculation unit 11 stores the INC calculated for each user atthe address corresponding to the user number of the user in the INCstorage memory 22 in step S209. The AFR calculation unit 11 also storesthe AFR calculated for each user at the address corresponding to theuser number of the user in the frame-rate-information storage memory 21in step S209.

The AFR calculation unit 11 may execute the processes of step S203 tostep S209, described above, for one user, and then the processes foreach of the other users in turn.

In the above description, the shaping apparatus 10 has used VLAN IDincluded in the header information as an identifier for identifying theuser; however, the shaping apparatus 10 may identify the user by usingother appropriate identifiers, such as an IP address and MPLS label.Inside the shaping apparatus, the user number has been used to identifythe user; however, an appropriate identifier (information) which canidentify each user, other than the user number, may be used.

In the above description, frames transmitted and received by the shapingapparatus 10 each have the reference number of bytes; however, theshaping apparatus 10 can transmit and receive frames having a number ofbytes different from the reference number of bytes. In this case, theOTIME calculation unit 12 calculates the first estimated transmissiontime A and second estimated transmission time P according to thefollowing expressions.First estimated transmission time A=(previous estimated transmissiontime)+INC×(number of bytes in the frame to be transmitted)/(referencenumber of bytes)Second estimated transmission time P=(previous estimated transmissiontime)+PINC×(number of bytes in the frame to be transmitted)/(referencenumber of bytes)

FIG. 6 shows the timing when the shaping apparatus 10 transmits frameshaving different numbers of bytes from the reference number of bytes.

It is assumed here, for example, that the maximum frame rate of the lineis 1 Gbps, the AFR is 500 Mbps, the INC is “2”, and the reference numberof bytes is 64. FIG. 6( a) shows the relationship between transmittedframes each having 64 bytes and time. FIG. 6( b) shows the relationshipbetween transmitted frames each having 128 bytes and time. FIG. 6( c)shows the relationship between transmitted frames each having 256 bytesand time. In this way, even if the frames to be transmitted havedifferent numbers of bytes, the shaping apparatus 10 can transmit theframes according to the AFR and PFR.

As described above, when the shaping apparatus 10 is used, any framerate left unused due to a change in the frame rate of a user can beeffectively used. For example, a frame rate conventionally left unusedby any user when the frame rate of a user becomes lower than the AFR orMFR can be effectively used.

1. A traffic shaping apparatus for controlling an allowed transmissionframe rate of user frames according to frame rates specified in advance,for each user who transmits and receives the user frames through anetwork, the traffic shaping apparatus comprising: a plurality of framequeues, each provided for a corresponding user, for storing the userframes of the corresponding user; a frame-rate storage section forstoring a minimum transmission frame rate and a peak transmission framerate specified for each user; a transmission-interval calculationsection for calculating an allowed transmission frame rate of userframes for each user by using the minimum transmission frame rate or thepeak transmission frame rate, for calculating a reference transmissioninterval of the user frames for each user by using the calculatedallowed transmission frame rate, and for calculating a minimumtransmission interval for each user by using the peak transmission framerate; a transmission-interval storage section for storing the referencetransmission interval and the minimum transmission interval for eachuser; a time calculation section for calculating a first estimatedtransmission time for each user by using the reference transmissioninterval and for calculating a second estimated transmission time foreach user by using the minimum transmission interval; a time storagesection for storing the first estimated transmission time and the secondestimated transmission time for each user; a determination section fordetermining the user having the earliest first estimated transmissiontime among one or more users corresponding to one or more frame queueswhere at least one user frame is stored, and for determining whether auser frame is to be transmitted according to the second estimatedtransmission time for the determined user; a frame reading section forreading the user frame from the frame queue corresponding to thedetermined user when the determination section has determined that theuser frame of the determined user is to be transmitted; and atransmission section for transmitting the read user frame.
 2. A trafficshaping apparatus according to claim 1, wherein thetransmission-interval calculation section calculates the minimumtransmission interval when the peak transmission frame rate is specifiedfor each user, periodically calculates the allowed transmission framerate and the reference transmission interval for each user, and storesthem in the transmission-interval storage section.
 3. A traffic shapingapparatus according to claim 1, wherein the frame-rate storage sectionfurther stores the maximum frame rate of a line through which a userframe of each user is transmitted, and the transmission-intervalcalculation section calculates the allowed transmission frame rate foreach user by using the maximum frame rate of the line and the minimumtransmission frame rate.
 4. A traffic shaping apparatus according toclaim 3, wherein the transmission-interval calculation sectioncalculates the allowed transmission frame rate for each user accordingto the following expression:Allowed transmission frame rate of user=(maximum frame rate of the linethrough which a user frame of the user is to be transmitted)×(minimumtransmission frame rate specified for the user)/(sum of minimumtransmission frame rates of active users who transmit user framesthrough the line).
 5. A traffic shaping apparatus according to claim 1,wherein the transmission-interval calculation section calculates thereference transmission interval for each user according to the followingexpression:Reference transmission interval of user=(maximum frame rate which thetraffic shaping apparatus can control)/(allowed transmission frame ratefor the user).
 6. A traffic shaping apparatus according to claim 1,wherein the transmission-interval calculation section calculates theminimum transmission interval for each user according to the followingexpression:Minimum transmission interval of user=(maximum frame rate which thetraffic shaping apparatus can control)/(maximum transmission frame ratefor the user).
 7. A traffic shaping apparatus according to claim 1,wherein the determination section instructs the time calculation sectionto calculate times when the determination section has determined thatthe user frame of the determined user is to be transmitted, and the timecalculation section calculates the first estimated transmission time andthe second estimated transmission time for the determined user andstores them in the time storage section when the time calculationsection is instructed by the determination section.
 8. A traffic shapingapparatus according to claim 7, wherein the time calculation sectioncalculates the first estimated transmission time and the secondestimated transmission time for each user according to the followingexpressions:First estimated transmission time=previous estimated transmissiontime+reference transmission interval for the user, andSecond estimated transmission time=previous estimated transmissiontime+minimum transmission interval for the user.
 9. A traffic shapingapparatus according to claim 1, wherein the determination sectiondetermines that a user frame is to be transmitted when the secondestimated transmission time for the determined user matches the currenttime or indicates a time in the past compared with the current time. 10.A traffic shaping apparatus according to claim 1, further comprising: areceiving section for receiving a user frame; an identification sectionfor identifying the user for whom the user frame is to be transmitted orreceived, according to information included in the user frame; and aframe storage section for storing the user frame in the frame queuecorresponding to the identified user.
 11. A traffic shaping apparatusaccording to claim 10, wherein the identification section determineswhether the user frame has been received in a state in which there is nouser frame in the frame queue corresponding to the identified user, andwhen the identification section determines that the user frame has beenreceived in said state, the identification section instructs the timecalculation section to calculate times, and the time calculation sectioncalculates the first estimated transmission time and the secondestimated transmission time for the identified user and stores them inthe time storage section when the time calculation section is instructedby the determination section.
 12. A traffic shaping apparatus accordingto claim 11, wherein the time calculation section calculates the firstestimated transmission time and the second estimated transmission timefor each user according to the following expressions:First estimated transmission time=current time+reference time, andSecond estimated transmission time=current time+reference time.
 13. Atraffic shaping method for controlling an allowed transmission framerate of user frames according to frame rates specified in advance, foreach user who transmits and receives the user frames through a network,the traffic shaping method comprising the steps of: setting a minimumtransmission frame rate and a peak transmission frame rate for eachuser; calculating a minimum transmission interval for each user by usingthe peak transmission frame rate; calculating an allowed transmissionframe rate of user frames for each user by using the minimumtransmission frame rate or the peak transmission frame rate; calculatinga reference transmission interval of the user frames for each user byusing the allowed transmission frame rate; calculating a first estimatedtransmission time for each user by using the reference transmissioninterval; calculating a second estimated transmission time for each userby using the minimum transmission interval; receiving a user frame foreach user and storing it in association with the user; determining theuser having the earliest first estimated transmission time among one ormore users for whom at least one user frame is stored; determiningwhether a user frame is to be transmitted according to the secondestimated transmission time of the determined user; and transmitting theuser frame of the determined user when it has been determined that theuser frame of the determined user is to be transmitted.
 14. A trafficshaping method according to claim 13, wherein, in the step ofcalculating the minimum transmission interval, the minimum transmissioninterval is calculated when the peak transmission frame rate isspecified for each user.
 15. A traffic shaping method according to claim13, wherein, in the steps of calculating the allowed transmission framerate and the reference transmission interval, the allowed transmissionframe rate and the reference transmission interval are periodicallycalculated for each user.
 16. A traffic shaping method according toclaim 13, wherein, in the steps of calculating the allowed transmissionframe rate, the reference transmission interval, and the minimumtransmission interval, the allowed transmission frame rate, thereference transmission interval, and the minimum transmission intervalare calculated for each user according to the following expressions:Allowed transmission frame rate of user=(maximum frame rate of the linethrough which a user frame of the user is to be transmitted)×(minimumtransmission frame rate specified for the user)/(sum of minimumtransmission frame rates of active users who transmit user framesthrough the line),Reference transmission interval of user=(maximum frame rate which thetraffic shaping apparatus can control)/(allowed transmission frame ratefor the user), andMinimum transmission interval of user=(maximum frame rate which thetraffic shaping apparatus can control)/(maximum transmission frame ratefor the user).
 17. A traffic shaping method according to claim 13,wherein, in the step of transmitting the user frame, the first estimatedtransmission time and the second estimated transmission time of thedetermined user are further calculated.
 18. A traffic shaping methodaccording to claim 17, wherein, in the steps of calculating the firstestimated transmission time and the second estimated transmission time,the first estimated transmission time and the second estimatedtransmission time are calculated according to the following expressions:First estimated transmission time=previous estimated transmissiontime+reference transmission interval for the user, andSecond estimated transmission time=previous estimated transmissiontime+minimum transmission interval for the user.
 19. A traffic shapingmethod according to claim 13, wherein, in the step of determiningwhether the user frame is to be transmitted, it is determined that theuser frame is to be transmitted when the second estimated transmissiontime of the determined user indicates the current time or a time in thepast compared with the current time.
 20. A relay apparatus connected toa plurality of lines, for relaying frames between the lines, comprising:a plurality of interface sections each connected to at least one of theplurality of lines, for transmitting and receiving a frame to and fromthe line, the plurality of interface sections each comprising a framebuffer for temporarily storing the frame; a relay section connected tothe plurality of interface sections, for determining the interfacesection connected to a line through which the frame is to betransmitted, according to header information included in a framereceived by the each interface sections, and for relaying the frame tothe determined interface section; and a traffic shaping apparatusconnected to at least one of the plurality of interface sections and tothe relay section, for controlling an allowed transmission frame rateaccording to frame rates specified in advance, for each user whotransmits and receives a frame through a line, and for transmitting aframe, the traffic shaping apparatus having: a frame-rate storagesection for storing a minimum transmission frame rate and a peaktransmission frame rate specified for each user; a transmission-intervalcalculation section for calculating an allowed transmission frame rateof frames for each user by using the minimum transmission frame rate orthe peak transmission frame rate, for calculating a referencetransmission interval of the frames for each user by using thecalculated allowed transmission frame rate, and for calculating aminimum transmission interval for each user by using the peaktransmission frame rate; a transmission-interval storage section forstoring the reference transmission interval and the minimum transmissioninterval for each user; a time calculation section for calculating afirst estimated transmission time for each user by using the referencetransmission interval and for calculating a second estimatedtransmission time for each user by using the minimum transmissioninterval; a time storage section for storing the first estimatedtransmission time and the second estimated transmission time for eachuser; a determination section for determining the user having theearliest first estimated transmission time among one or more users forwhom at least one frame is stored in the frame buffer, and fordetermining whether a frame is to be transmitted according to the secondestimated transmission time of the determined user; a frame readingsection for reading the frame of the determined user from the framebuffer when the determination section has determined that the frame ofthe determined user is to be transmitted; and a transmission section fortransmitting the read frame to one of the lines through one of theplurality of interface sections.